package com.kangyi.admin.mapper;

import com.github.pagehelper.Page;
import com.kangyi.admin.annotation.AutoFill;
import com.kangyi.dto.HealthDataPageQueryDTO;
import com.kangyi.entity.FourHigh;
import com.kangyi.enumeration.OperationType;
import com.kangyi.vo.GuestVO;
import com.kangyi.vo.HealthDataDetailVO;
import com.kangyi.vo.HealthDataPageQueryVO;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * @author Blank
 * @version 1.0
 */
@Mapper
public interface HealthDataMapper {
    Page<HealthDataPageQueryVO> pageQuery(HealthDataPageQueryDTO healthDataPageQueryDTO);


    void deleteHealthData(List<Integer> ids);

    @Insert("insert into four_high(guest_id, blood_sugar, blood_pressure_systolic, blood_pressure_diastolic, blood_lipids, uric_acid, create_user, update_user,create_time,update_time) " +
            "VALUES(#{guestId},#{bloodSugar},#{bloodPressureSystolic},#{bloodPressureDiastolic},#{bloodLipids},#{uricAcid},#{createUser},#{updateUser},#{createTime},#{updateTime}) ")
    @AutoFill(value = OperationType.INSERT)
    void addHealthData(FourHigh fourHigh);

    @Select("select * from guests_staying where nursing_home_id = #{nursingHomeId}")
    List<GuestVO> getByGuestId(Integer nursingHomeId);

    HealthDataDetailVO detailFourHigh(Integer fourHighId);

    @AutoFill(value = OperationType.UPDATE)
    void editHealthData(FourHigh build);
}
